package viewcomponents.registration
{
	import flash.events.MouseEvent;
	
	import fui.FUIControllers.FUIRegistrationEvent;
	import fui.FUIControllers.UISession;
	
	import mx.containers.Canvas;
	import mx.containers.HBox;
	import mx.containers.VBox;
	import mx.controls.Button;
	
	import viewcomponents.IComponent;
	//
	[Event(name="cancel", type="fui.FUIControllers.FUIRegistrationEvent")]
	//
	[Event(name="submit", type="fui.FUIControllers.FUIRegistrationEvent")]
	
	public class RegistrationPanel extends Canvas implements IComponent
	{
		
		private var vbox:VBox = new VBox();
		private var hbox:HBox = new HBox();
		
		private var _componentID:Number;
	
		public var accordion:RegistrationAccordion;
		private var cancelButton:Button;
		private var submitButton:Button;
		
		
		public function RegistrationPanel()
		{
			super();
			
			vbox.percentWidth = 100;
			vbox.percentHeight = 100;
			addChild(vbox);
			
			accordion = new RegistrationAccordion();
			accordion.percentWidth = 100;
			accordion.percentHeight = 100;
			vbox.addChild(accordion);
			
			hbox.percentWidth = 100;
			vbox.addChild(hbox);
			
			cancelButton = new Button();
			cancelButton.label = "Cancel";
			hbox.addChild(cancelButton);
			
			submitButton = new Button();
			submitButton.label = "Submit";
			hbox.addChild(submitButton);
			submitButton.addEventListener(MouseEvent.CLICK, submitOnClick);
		}
		
		private function submitOnClick(event:MouseEvent):void{
			dispatchEvent(new FUIRegistrationEvent(FUIRegistrationEvent.SUBMIT));
		}
		
		public function set componentID(value:Number):void{
			if(!_componentID){
				_componentID = value;
			}
		}
		
		public function get componentID():Number
		{
			return _componentID;
		}
		
		public function set xmlSource(xml_path:String):void
		{
		}
		
		public function set session(uis:UISession):void
		{
		}
		
		public function get componentTitle():String
		{
			return null;
		}
		
		public function showComponent():void
		{
		}
		
		public function hideComponent():void
		{
		}
		
		public function isNeedAuth():Boolean
		{
			return false;
		}
		
		public function selfRemove():void
		{
		}
		
	}
}